package models

const (
	OrderTime  = "time"
	OrderScore = "score"
)

// //注册数据模型
type ParamsSignUp struct {
	Username    string `json:"username" form:"username" binding:"required"`
	Password    string `json:"password" form:"password" binding:"required"`
	Re_Passowrd string `json:"re_password" form:"re_password" binding:"required,eqfield=Password"`
}

// 登录数据模型
type ParamsLogin struct {
	Username string `json:"username" form:"username" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

// 投票数据
type ParamVoteDataForm struct {
	//UserID int 从请求中获取当前的用户
	PostID    string `json:"post_id" binding:"required"`              // 帖子id
	Direction int8   `json:"direction,string" binding:"oneof=1 0 -1"` // 赞成票(1)还是反对票(-1)取消投票(0)
}

// redis 查找数据的模型
type ParamPostIndexListForm struct {
	Page        int64  `json:"page" form:"page"`                 // 页码
	Size        int64  `json:"size" form:"size"`                 // 每页数量
	CommunityID int64  `json:"community_id" form:"community_id"` // 可以为空
	Order       string `json:"order" form:"sie"`                 //排序依据
}

//按社区获取帖子列表 query string 参数
type ParamCommunityPostList struct {
	*ParamPostIndexListForm
	CommunityID int64 `json:"community_id" form:"community_id"`
}
